package com.neuedu.mapper;

import com.neuedu.po.Income;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface IncomeMapper {

    //根据uname 和 source 做模糊匹配，在映射文件里面写sql语句
    public List<Income> selectAllincome(Income i);

    @Select("select * from fa_income where id=#{id}")
    public Income selectById(Income i);
    @Insert("insert into fa_income(uname,money,type,earner,earnDate,source,remark) values (#{uname},#{money},#{type},#{earner},#{earnDate},#{source},#{remark})")
    public int add(Income i);
    @Update("update fa_income set uname=#{uname},money=#{money},type=#{type},earner=#{earner},earnDate=#{earnDate},source=#{source},remark=#{remark} where id=#{id}")
    public int update(Income i);
    @Delete("delete from fa_income where id=#{id}")
    public int delete(Income i);

}
